//
//  CouponTableViewCell.m
//  Doctors
//
//  Created by 王森 on 16/4/13.
//  Copyright © 2016年 王森. All rights reserved.
//

#import "CouponTableViewCell.h"
#import "UIImageView+WebCache.h"
@implementation CouponTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)cellFuzhi:(YouHuiQuanModel *)model
{
    self.title.text=model.couponName;
    self.subTitle.text=[NSString stringWithFormat:@"优惠码：%@",model.couponCode];
    self.shengYuCount.text=[NSString stringWithFormat:@"剩余%d张",model.count];
    [self.erWeiMa sd_setImageWithURL:[NSURL URLWithString:model.QRcode]];
    int amountInt=[model.amount intValue];
    
    NSString *mianzhi=nil;
    
    if (amountInt==30) {
        mianzhi=@"V3";
    }
    else if (amountInt==50)
    {
        mianzhi=@"V5";

    }
    else if (amountInt==60)
    {
        mianzhi=@"V6";
        
    }
    else{
        mianzhi=@"M";
        
 
    }
    
    self.amount.text=[NSString stringWithFormat:@"%@",mianzhi];
    
    
    
    if (amountInt==0) {
        self.bgImageView.image=IMAGE(@"bg_youhuiquan_yishiyong");
        
    }
    else
    {
        self.bgImageView.image=IMAGE(@"bg_youhuiquan");
  
    }
    
    
    
}

@end
